<?php

class RegisterController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        // action body
        $registerform = new Application_Form_Registerform();
        $this->view->registerform = $registerform;

        if($this->_request->isPost() && $registerform->isValid($this->_request->getPost()))
        {
            $user = new Application_Model_User($this->_request->getPost());
            $user->setLast_ip($this->_request->getServer('REMOTE_ADDR') );
            $user->setBalance(0);
            $user->setJoined(date('Y-m-d'));
            $user->setSuspended(0);
            $user->setVerified(0);
            $user->setOnline(0);
            $user->setCountry(' ');
            $user->setStreetaddress('');
            $user->setReferred_by('');

            $userMapper = new Application_Model_UserMapper();
            $newId = $userMapper->add($user);
            $this->_redirect('/register/success');
        }

    }

    public function successAction()
    {
        // action body
        $this->view->message = "We need to confirm that you're a real person. Check your inbox to verify your email address."; 
        //sdsdsdsd
    }

    public function validateAction()
    {
        // action body
        $this->view->message = "Thank you verifying your account, have fun and earn Shadow Crystal points";
    }

    public function forgotpassAction()
    {
        // action body
        $this->view->message = "Forgot Password Here!";
    }


}







